From e964e176f927047365ca564e73de41b0fff713f3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 15 Jan 2021 01:07:47 -0500 Subject: [PATCH] widget-factory: Use the new themes Update the Style menu to switch between the variants of the Default theme. --- demos/widget-factory/widget-factory.c | 31 ++++++++------------------ demos/widget-factory/widget-factory.ui | 16 ++++++------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c index 8e8da85f4a..220ba204fa 100644 --- a/demos/widget-factory/widget-factory.c +++ b/demos/widget-factory/widget-factory.c @@ -50,32 +50,19 @@ change_theme_state (GSimpleAction *action, GtkSettings *settings = gtk_settings_get_default (); const char *s; const char *theme; - gboolean prefer_dark = FALSE; g_simple_action_set_state (action, state); s = g_variant_get_string (state, NULL); - if (strcmp (s, "adwaita") == 0) - { - theme = "Adwaita"; - prefer_dark = FALSE; - } - else if (strcmp (s, "adwaita-dark") == 0) - { - theme = "Adwaita"; - prefer_dark = TRUE; - } - else if (strcmp (s, "highcontrast") == 0) - { - theme = "HighContrast"; - prefer_dark = FALSE; - } - else if (strcmp (s, "highcontrast-inverse") == 0) - { - theme = "HighContrastInverse"; - prefer_dark = FALSE; - } + if (strcmp (s, "default") == 0) + theme = "Default"; + else if (strcmp (s, "dark") == 0) + theme = "Default-dark"; + else if (strcmp (s, "hc") == 0) + theme = "Default-hc"; + else if (strcmp (s, "hc-dark") == 0) + theme = "Default-hc-dark"; else if (strcmp (s, "current") == 0) { gtk_settings_reset_property (settings, "gtk-theme-name"); @@ -87,7 +74,7 @@ change_theme_state (GSimpleAction *action, g_object_set (G_OBJECT (settings), "gtk-theme-name", theme, - "gtk-application-prefer-dark-theme", prefer_dark, + "gtk-application-prefer-dark-theme", FALSE, NULL); } diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index 2153591e30..269b3f459f 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -15,24 +15,24 @@ current - Adwaita + Default win.theme - adwaita + default - Adwaita dark + Dark win.theme - adwaita-dark + dark - High contrast + Highcontrast win.theme - highcontrast + hc - High contrast inverse + Highcontrast inverse win.theme - highcontrast-inverse + hc-dark -- 2.30.2